/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;

import org.springframework.web.multipart.commons.CommonsMultipartFile;

/**
 *
 * @author root
 */
@Entity
@Table(name = "menucategory")
@XmlRootElement(name = "menucategory")
@NamedQueries({
    @NamedQuery(name = "Menucategory.findAll", query = "SELECT m FROM Menucategory m"),
    @NamedQuery(name = "Menucategory.findByMenucategoryID", query = "SELECT m FROM Menucategory m WHERE m.menucategoryID = :menucategoryID"),
    @NamedQuery(name = "Menucategory.findByMenucategoryname", query = "SELECT m FROM Menucategory m WHERE m.menucategoryname = :menucategoryname"),
    @NamedQuery(name = "Menucategory.findByCreateddate", query = "SELECT m FROM Menucategory m WHERE m.createddate = :createddate"),
    @NamedQuery(name = "Menucategory.findByLastupdation", query = "SELECT m FROM Menucategory m WHERE m.lastupdation = :lastupdation"),
    @NamedQuery(name = "Menucategory.findByDeleteddate", query = "SELECT m FROM Menucategory m WHERE m.deleteddate = :deleteddate"),
    @NamedQuery(name = "Menucategory.findByIsdeleted", query = "SELECT m FROM Menucategory m WHERE m.isdeleted = :isdeleted"),
    @NamedQuery(name = "Menucategory.findByImagepath", query = "SELECT m FROM Menucategory m WHERE m.imagepath = :imagepath")})
public class Menucategory implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MenucategoryID")
    private Long menucategoryID;
    @Column(name = "menucategoryname")
    private String menucategoryname;
    @Column(name = "createddate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createddate;
    @Column(name = "lastupdation")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastupdation;
    @Column(name = "deleteddate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date deleteddate;
    @Column(name = "isdeleted")
    private Boolean isdeleted;
    @Column(name = "imagepath")
    private String imagepath;
    @Column(name = "iconpath")
    private String iconpath;
    @JoinColumn(name = "employee_EmployeeID_updatedby", referencedColumnName = "EmployeeID")
    @ManyToOne
    private Employee employee;
    @JoinColumn(name = "employee_EmployeeID_deletedby", referencedColumnName = "EmployeeID")
    @ManyToOne
    private Employee employee1;
    
    @Transient
    private CommonsMultipartFile fileData;
    
    @Transient
    private CommonsMultipartFile fileDataIcon;
    
    @Transient
    private String alreadyexist;
    
    public String getAlreadyexist() {
		return alreadyexist;
	}

	public void setAlreadyexist(String alreadyexist) {
		this.alreadyexist = alreadyexist;
	}

	public CommonsMultipartFile getFileData() {
		return fileData;
	}

	public void setFileData(CommonsMultipartFile fileData) {
		this.fileData = fileData;
	}

	public Menucategory() {
    }

    public Menucategory(Long menucategoryID) {
        this.menucategoryID = menucategoryID;
    }

    public Long getMenucategoryID() {
        return menucategoryID;
    }

    public void setMenucategoryID(Long menucategoryID) {
        this.menucategoryID = menucategoryID;
    }

    public String getMenucategoryname() {
        return menucategoryname;
    }

    public void setMenucategoryname(String menucategoryname) {
        this.menucategoryname = menucategoryname;
    }

    public Date getCreateddate() {
        return createddate;
    }

    public void setCreateddate(Date createddate) {
        this.createddate = createddate;
    }

    public Date getLastupdation() {
        return lastupdation;
    }

    public void setLastupdation(Date lastupdation) {
        this.lastupdation = lastupdation;
    }

    public Date getDeleteddate() {
        return deleteddate;
    }

    public void setDeleteddate(Date deleteddate) {
        this.deleteddate = deleteddate;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public String getImagepath() {
        return imagepath;
    }

    public void setImagepath(String imagepath) {
        this.imagepath = imagepath;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    public Employee getEmployee1() {
        return employee1;
    }

    public void setEmployee1(Employee employee1) {
        this.employee1 = employee1;
    }
    
    public String getIconpath() {
		return iconpath;
	}

	public void setIconpath(String iconpath) {
		this.iconpath = iconpath;
	}
	
	public CommonsMultipartFile getFileDataIcon() {
		return fileDataIcon;
	}

	public void setFileDataIcon(CommonsMultipartFile fileDataIcon) {
		this.fileDataIcon = fileDataIcon;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (menucategoryID != null ? menucategoryID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Menucategory)) {
            return false;
        }
        Menucategory other = (Menucategory) object;
        if ((this.menucategoryID == null && other.menucategoryID != null) || (this.menucategoryID != null && !this.menucategoryID.equals(other.menucategoryID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Menucategory[menucategoryID=" + menucategoryID + "]";
    }

}
